﻿using System;
using System.Data;
using System.Web;

using OurCouse.DBTask;

namespace OurCouse.WebApp.Proxy
{
	public class RegUserDBTaskProxy
	{
		public DataSet GetRegUserList()
		{
			DataSet ds = HttpContext.Current.Cache["RegUser"] as DataSet;

			if (ds == null)
			{
				ds = (new RegUserDBTask()).GetRegUserList();
				HttpContext.Current.Cache.Insert("RegUser", ds);
			}

			return ds;
		}

		public Boolean AddUser(string username, string password)
		{
			//HttpContext.Current.Cache.Remove("RegUser");

			return (new RegUserDBTask()).AddUser(username, password);
		}

		/// <summary>
		/// 用户登录
		/// </summary>
		public Boolean UserLogin(string username, string password)
		{
			return (new RegUserDBTask()).UserLogin(username, password);
		}
	}
}
